package com.vidmt.api.modules.sys.shiro;

import org.apache.shiro.SecurityUtils;

import com.vidmt.api.modules.sys.entity.User;

public class ShiroUtil {
	public static MyPrincipal getPrincipal(){
		return (MyPrincipal) SecurityUtils.getSubject().getPrincipal();
	}
	public static User getCurrentUser(){
		MyPrincipal principal = getPrincipal();
		if(principal!=null){
			return principal.getUser();
		}
		return null;
	}

}
